import { instance } from './request.js'

export const getLocation = () => {
    return instance({
        url: '/v3/ip',
        method: 'GET',
        params: {
            key: 'f39d7d03d88e44202332bb4e650a1c15',

        }
    })
}

export const getAdCode = (adress) => {
    return instance({
        url: '/v3/geocode/geo',
        method: 'GET',
        params: {
            key: 'f39d7d03d88e44202332bb4e650a1c15',
            address: adress,
        }
    })
}

export const getWeather = (adcodes) => {
    return instance({
        url: '/v3/weather/weatherInfo',
        method: 'GET',
        params: {
            city: adcodes,
            extensions: 'base',
            key: 'f39d7d03d88e44202332bb4e650a1c15',
        }
    })
}
export const getWeatherForecast = (adcodes) => {
    return instance({
        url: '/v3/weather/weatherInfo',
        method: 'GET', 
        params: {
            city: adcodes,
            extensions: 'all', 
            key: 'f39d7d03d88e44202332bb4e650a1c15',

        }
    }) 
}